<script setup lang="ts">
defineProps({
  money: {
    type: Number,
    default: 0
  }
})

const emit = defineEmits<{
  // (e:'自定义事件名',value: 修改的值的类型): void　
  (e: 'update:money', value: number): void
}>()
const changeMoney = () => {
  emit('update:money', 10)
}
</script>
<template>
  <div style="border: 2px solid #000; margin: 20px">
    子组件 -- {{ money }} <button @click="changeMoney">changeMoney</button>
  </div>
</template>
<style scoped>
</style>